<?php echo form_open(uri_string(), 'class="crud" id="rate-form"'); ?>
<?php echo form_hidden('escort_id', $escort->getId()) ?>
<?php 
	$paymentSelectedArray = $escort->getPaymentMethodIds() ? explode(',',$escort->getPaymentMethodIds()):array();
	$extraSelectedArray = $escort->getExtrasIds() ? explode(',',$escort->getExtrasIds()):array();
	$currentPricingTimeArray = $escort->getPricingTimeIdArray($escort->getId());
?>
<fieldset>
	<ul id="personal-content" class="ui-sortable form_inputs">
		<li class="" id="header">
			<label for="header">&nbsp;</label>
			<div class="input type-text four-column">
				<div class="four-column-first">
					&nbsp;
				</div>
				<div class="four-column-second">
					&nbsp;
				</div>
				<div class="four-column-third">
				<?php echo lang('escort_be_escort_public_label')?>
				</div>
				<div class="four-column-fourth">
				<?php echo lang('escort_be_escort_locked_label')?>
				</div>
			</div>
		</li>
		<li class="" id="personal_visit">
			<label for="site_name"><?php echo lang('escort_be_escort_rate_payment_label')?></label>
			<div class="input type-text four-column">
				<div class="four-column-first">
				<?php echo form_multi_checkbox('rates_payment', getPaymentTypesData_ioc(), $paymentSelectedArray );?>
				</div>
				<div class="four-column-second">
				&nbsp;
				</div>
				<div class="four-column-third">
				<?php echo form_checkbox('public_payment_method', 1, $escort->getPublicPaymentMethod (), 'class="escort-checkbox"')?>
				</div>
				<div class="four-column-fourth">
				<?php echo form_checkbox('locked_payment_method',1,$lockedEscort->getLockedPaymentMethod(), 'class="escort-checkbox"')?>
				</div>
			</div>
		</li>
		<li class="" id="personal_position">
			<?php $i = 0;?>
			<?php foreach(getPricingTimeData_ioc() as $key=>$value):?>
			<?php 
				$i++;
				$checked = in_array($key, $currentPricingTimeArray) ? 'checked="checked"':''; 
				$PRICE_OBJ = $escort->getPricingTime($escort->getId(), $key);
				$price = $PRICE_OBJ ? $PRICE_OBJ->price :'';
			?>
			<?php if($i == 1){?>
			<label for="site_name"><?php echo lang('escort_be_escort_rate_pricing_label')?></label>
			<?php }else{?>
			<label for="site_name">&nbsp;</label>
			<?php }?>
			<div class="input type-text four-column">
				<div class="four-column-first">
					<div class="checkbox-wrapper">
						<input type="checkbox" name="rates_price_time[<?php echo $key?>]" class="custom" value="<?php echo $key?>" <?php echo $checked;?>/>	<label><?php echo $value;?></label>
					</div>
				</div>
				<div class="four-column-second">
					<input type="text" value="<?php echo $price;?>" name="rates_price_value_<?php echo $key;?>" id="rates_price_value_<?php echo $key;?>" class="text-box" style="text-align:center;" /> &euro;
				</div>
				<div class="four-column-third">
				<?php if($i == 1){?>
				<?php echo form_checkbox('public_pricing_time', 1, $escort->getPublicPricingTime(), 'class="escort-checkbox"')?>
				<?php }else{?>
					&nbsp;
				<?php }?>
				</div>
				<div class="four-column-fourth">
				<?php if($i == 1){?>
				<?php echo form_checkbox('locked_pricing_time',1,$lockedEscort->getLockedPricingTime(), 'class="escort-checkbox"')?>
				<?php }else{?>
					&nbsp;
				<?php }?>
				</div>
			</div>
			<?php endforeach;?>
		</li>
		<li class="" id="personal_contact_data">
			<label for="escort_birthday"><?php echo lang('escort_be_escort_rate_transport_label')?></label>
			<div class="input type-text four-column">
				<div class="four-column-first">
				<?php echo form_dropdown('rates_transport_id', getTransportData_ioc(), array($escort->getTransportIncludeId()) , 'id="rates_transport_id" class="custom"' );?>
				</div>
				<div class="four-column-second">
				&nbsp;
				</div>
				<div class="four-column-third">
				<?php echo form_checkbox('public_transport_include', 1, $escort->getPublicTransportInclude(), 'class="escort-checkbox"')?>
				</div>
				<div class="four-column-fourth">
				<?php echo form_checkbox('locked_transport',1,$lockedEscort->getLockedTransport(), 'class="escort-checkbox"')?>
				</div>
			</div>
		</li>
		<li class="" id="personal_current_services">
			<label for="escort_birthday"><?php echo lang('escort_be_escort_rate_extras_label')?></label>
			<div class="input type-text four-column">
				<div class="four-column-first">
				<?php echo form_multi_checkbox('rates_extras', getExtrasData_ioc(), $extraSelectedArray );?>
				</div>
				<div class="four-column-second">
					&nbsp;				
				</div>
				<div class="four-column-third">
				<?php echo form_checkbox('public_extras', 1, $escort->getPublicExtras(), 'class="escort-checkbox"')?>
				</div>
				<div class="four-column-fourth">
				<?php echo form_checkbox('locked_extras',1,$lockedEscort->getLockedExtras(), 'class="escort-checkbox"')?>
				</div>
			</div>
		</li>
	</ul>
	<?php echo form_button(array('id'=>'save-rate', 'onClick'=>'saveRate()','name'=>'add', 'class'=>'btn blue', 'value'=>lang('escort_be_escort_rate_save_label'), 'content'=>lang('escort_be_escort_rate_save_label')))?>
</fieldset>
<?php echo form_close()?>